package com.shylock.as.api.controller;

import com.shylock.as.entity.SmsLog;
import com.shylock.as.manager.intf.AliSmsService;

import com.shylock.common.bo.SmsLogBo;
import com.shylock.common.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("api/sms")
//@CrossOrigin
@Api(value = "实现短信操作接口",tags = "实现短信操作接口")
public class AliSmsController {
    @Autowired
     private AliSmsService service;
    @ApiOperation(value = "发送注册验证码",notes = "发送注册验证码")
    @GetMapping("sendrcode")
    public R sendR(String phone){
        return service.sendRCode(phone);
    }
    
    @ApiOperation(value = "校验注册验证码",notes = "校验注册验证码")
    @PostMapping("checkrcode")
    public R checkR(@RequestBody SmsLogBo bo){
        return service.checkRCode(bo);
    }

    @ApiOperation(value = "发送登录验证码",notes = "发送登录验证码")
    @GetMapping("sendlcode")
    public R sendLCode(String phone){
        return service.sendLCode(phone);
    }
    
    @ApiOperation(value = "发送找回密码验证码",notes = "发送找回密码验证码")
    @GetMapping("sendfcode")
    public R sendFCode(String phone){
        return service.sendFCode(phone);
    }

    
}
